Integrand size = 41, antiderivative size = 139 \[ \int \frac {\cos ^3(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=-\frac {(3 A-3 B+2 C) x}{2 a}+\frac {(4 A-3 B+3 C) \sin (c+d x)}{a d}-\frac {(3 A-3 B+2 C) \cos (c+d x) \sin (c+d x)}{2 a d}-\frac {(A-B+C) \cos ^2(c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}-\frac {(4 A-3 B+3 C) \sin ^3(c+d x)}{3 a d} \]
-1/2*(3*A-3*B+2*C)*x/a+(4*A-3*B+3*C)*sin(d*x+c)/a/d-1/2*(3*A-3*B+2*C)*cos( d*x+c)*sin(d*x+c)/a/d-(A-B+C)*cos(d*x+c)^2*sin(d*x+c)/d/(a+a*sec(d*x+c))-1 /3*(4*A-3*B+3*C)*sin(d*x+c)^3/a/d
Leaf count is larger than twice the leaf count of optimal. \(307\) vs. \(2(139)=278\).
Time = 2.18 (sec) , antiderivative size = 307, normalized size of antiderivative = 2.21 \[ \int \frac {\cos ^3(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=\frac {\cos \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {c}{2}\right ) \left (-12 (3 A-3 B+2 C) d x \cos \left (\frac {d x}{2}\right )-12 (3 A-3 B+2 C) d x \cos \left (c+\frac {d x}{2}\right )+69 A \sin \left (\frac {d x}{2}\right )-60 B \sin \left (\frac {d x}{2}\right )+60 C \sin \left (\frac {d x}{2}\right )+21 A \sin \left (c+\frac {d x}{2}\right )-12 B \sin \left (c+\frac {d x}{2}\right )+12 C \sin \left (c+\frac {d x}{2}\right )+18 A \sin \left (c+\frac {3 d x}{2}\right )-9 B \sin \left (c+\frac {3 d x}{2}\right )+12 C \sin \left (c+\frac {3 d x}{2}\right )+18 A \sin \left (2 c+\frac {3 d x}{2}\right )-9 B \sin \left (2 c+\frac {3 d x}{2}\right )+12 C \sin \left (2 c+\frac {3 d x}{2}\right )-2 A \sin \left (2 c+\frac {5 d x}{2}\right )+3 B \sin \left (2 c+\frac {5 d x}{2}\right )-2 A \sin \left (3 c+\frac {5 d x}{2}\right )+3 B \sin \left (3 c+\frac {5 d x}{2}\right )+A \sin \left (3 c+\frac {7 d x}{2}\right )+A \sin \left (4 c+\frac {7 d x}{2}\right )\right )}{24 a d (1+\cos (c+d x))} \]
(Cos[(c + d*x)/2]*Sec[c/2]*(-12*(3*A - 3*B + 2*C)*d*x*Cos[(d*x)/2] - 12*(3 *A - 3*B + 2*C)*d*x*Cos[c + (d*x)/2] + 69*A*Sin[(d*x)/2] - 60*B*Sin[(d*x)/ 2] + 60*C*Sin[(d*x)/2] + 21*A*Sin[c + (d*x)/2] - 12*B*Sin[c + (d*x)/2] + 1 2*C*Sin[c + (d*x)/2] + 18*A*Sin[c + (3*d*x)/2] - 9*B*Sin[c + (3*d*x)/2] + 12*C*Sin[c + (3*d*x)/2] + 18*A*Sin[2*c + (3*d*x)/2] - 9*B*Sin[2*c + (3*d*x )/2] + 12*C*Sin[2*c + (3*d*x)/2] - 2*A*Sin[2*c + (5*d*x)/2] + 3*B*Sin[2*c + (5*d*x)/2] - 2*A*Sin[3*c + (5*d*x)/2] + 3*B*Sin[3*c + (5*d*x)/2] + A*Sin [3*c + (7*d*x)/2] + A*Sin[4*c + (7*d*x)/2]))/(24*a*d*(1 + Cos[c + d*x]))
Time = 0.59 (sec) , antiderivative size = 118, normalized size of antiderivative = 0.85, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.220, Rules used = {3042, 4572, 3042, 4274, 3042, 3113, 2009, 3115, 24}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cos ^3(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a \sec (c+d x)+a} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+B \csc \left (c+d x+\frac {\pi }{2}\right )+C \csc \left (c+d x+\frac {\pi }{2}\right )^2}{\csc \left (c+d x+\frac {\pi }{2}\right )^3 \left (a \csc \left (c+d x+\frac {\pi }{2}\right )+a\right )}dx\) |
\(\Big \downarrow \) 4572 |
\(\displaystyle \frac {\int \cos ^3(c+d x) (a (4 A-3 B+3 C)-a (3 A-3 B+2 C) \sec (c+d x))dx}{a^2}-\frac {(A-B+C) \sin (c+d x) \cos ^2(c+d x)}{d (a \sec (c+d x)+a)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {a (4 A-3 B+3 C)-a (3 A-3 B+2 C) \csc \left (c+d x+\frac {\pi }{2}\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )^3}dx}{a^2}-\frac {(A-B+C) \sin (c+d x) \cos ^2(c+d x)}{d (a \sec (c+d x)+a)}\) |
\(\Big \downarrow \) 4274 |
\(\displaystyle \frac {a (4 A-3 B+3 C) \int \cos ^3(c+d x)dx-a (3 A-3 B+2 C) \int \cos ^2(c+d x)dx}{a^2}-\frac {(A-B+C) \sin (c+d x) \cos ^2(c+d x)}{d (a \sec (c+d x)+a)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a (4 A-3 B+3 C) \int \sin \left (c+d x+\frac {\pi }{2}\right )^3dx-a (3 A-3 B+2 C) \int \sin \left (c+d x+\frac {\pi }{2}\right )^2dx}{a^2}-\frac {(A-B+C) \sin (c+d x) \cos ^2(c+d x)}{d (a \sec (c+d x)+a)}\) |
\(\Big \downarrow \) 3113 |
\(\displaystyle \frac {-\frac {a (4 A-3 B+3 C) \int \left (1-\sin ^2(c+d x)\right )d(-\sin (c+d x))}{d}-a (3 A-3 B+2 C) \int \sin \left (c+d x+\frac {\pi }{2}\right )^2dx}{a^2}-\frac {(A-B+C) \sin (c+d x) \cos ^2(c+d x)}{d (a \sec (c+d x)+a)}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {-a (3 A-3 B+2 C) \int \sin \left (c+d x+\frac {\pi }{2}\right )^2dx-\frac {a (4 A-3 B+3 C) \left (\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}}{a^2}-\frac {(A-B+C) \sin (c+d x) \cos ^2(c+d x)}{d (a \sec (c+d x)+a)}\) |
\(\Big \downarrow \) 3115 |
\(\displaystyle \frac {-a (3 A-3 B+2 C) \left (\frac {\int 1dx}{2}+\frac {\sin (c+d x) \cos (c+d x)}{2 d}\right )-\frac {a (4 A-3 B+3 C) \left (\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}}{a^2}-\frac {(A-B+C) \sin (c+d x) \cos ^2(c+d x)}{d (a \sec (c+d x)+a)}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {-\frac {a (4 A-3 B+3 C) \left (\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}-a (3 A-3 B+2 C) \left (\frac {\sin (c+d x) \cos (c+d x)}{2 d}+\frac {x}{2}\right )}{a^2}-\frac {(A-B+C) \sin (c+d x) \cos ^2(c+d x)}{d (a \sec (c+d x)+a)}\) |
-(((A - B + C)*Cos[c + d*x]^2*Sin[c + d*x])/(d*(a + a*Sec[c + d*x]))) + (- (a*(3*A - 3*B + 2*C)*(x/2 + (Cos[c + d*x]*Sin[c + d*x])/(2*d))) - (a*(4*A - 3*B + 3*C)*(-Sin[c + d*x] + Sin[c + d*x]^3/3))/d)/a^2
3.5.56.3.1 Defintions of rubi rules used
Int[sin[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1) Subst[Int[Exp and[(1 - x^2)^((n - 1)/2), x], x], x, Cos[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[(n - 1)/2, 0]
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* x]*((b*Sin[c + d*x])^(n - 1)/(d*n)), x] + Simp[b^2*((n - 1)/n) Int[(b*Sin [c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && IntegerQ[ 2*n]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[a Int[(d*Csc[e + f*x])^n, x], x] + Simp[b/d In t[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. ))*(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a _))^(m_), x_Symbol] :> Simp[(-(a*A - b*B + a*C))*Cot[e + f*x]*(a + b*Csc[e + f*x])^m*((d*Csc[e + f*x])^n/(a*f*(2*m + 1))), x] - Simp[1/(a*b*(2*m + 1)) Int[(a + b*Csc[e + f*x])^(m + 1)*(d*Csc[e + f*x])^n*Simp[a*B*n - b*C*n - A*b*(2*m + n + 1) - (b*B*(m + n + 1) - a*(A*(m + n + 1) - C*(m - n)))*Csc[ e + f*x], x], x], x] /; FreeQ[{a, b, d, e, f, A, B, C, n}, x] && EqQ[a^2 - b^2, 0] && LtQ[m, -2^(-1)]
Time = 0.26 (sec) , antiderivative size = 87, normalized size of antiderivative = 0.63
method | result | size |
parallelrisch | \(\frac {\left (\left (-A +3 B \right ) \cos \left (2 d x +2 c \right )+A \cos \left (3 d x +3 c \right )+\left (17 A -6 B +12 C \right ) \cos \left (d x +c \right )+31 A -21 B +24 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-18 x \left (A -B +\frac {2 C}{3}\right ) d}{12 d a}\) | \(87\) |
derivativedivides | \(\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) A -\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B +\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C -\frac {2 \left (\left (\frac {3 B}{2}-\frac {5 A}{2}-C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}+\left (2 B -\frac {8 A}{3}-2 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+\left (\frac {B}{2}-\frac {3 A}{2}-C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}-\left (3 A -3 B +2 C \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) | \(147\) |
default | \(\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) A -\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B +\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C -\frac {2 \left (\left (\frac {3 B}{2}-\frac {5 A}{2}-C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}+\left (2 B -\frac {8 A}{3}-2 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+\left (\frac {B}{2}-\frac {3 A}{2}-C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}-\left (3 A -3 B +2 C \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}\) | \(147\) |
risch | \(-\frac {3 A x}{2 a}+\frac {3 B x}{2 a}-\frac {x C}{a}-\frac {7 i A \,{\mathrm e}^{i \left (d x +c \right )}}{8 a d}+\frac {i B \,{\mathrm e}^{i \left (d x +c \right )}}{2 a d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} C}{2 a d}+\frac {7 i A \,{\mathrm e}^{-i \left (d x +c \right )}}{8 a d}-\frac {i {\mathrm e}^{-i \left (d x +c \right )} B}{2 a d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} C}{2 a d}+\frac {2 i A}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}-\frac {2 i B}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {2 i C}{d a \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {A \sin \left (3 d x +3 c \right )}{12 a d}-\frac {A \sin \left (2 d x +2 c \right )}{4 a d}+\frac {\sin \left (2 d x +2 c \right ) B}{4 a d}\) | \(260\) |
norman | \(\frac {\frac {\left (A -B +C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{a d}+\frac {\left (3 A -3 B +2 C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a}+\frac {\left (7 A -5 B +4 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{a d}+\frac {\left (3 A -3 B +2 C \right ) x}{2 a}+\frac {\left (A -3 B +6 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{3 a d}-\frac {\left (3 A -3 B +2 C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{a}-\frac {\left (3 A -3 B +2 C \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{2 a}-\frac {\left (4 A -2 B +3 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}-\frac {\left (13 A -15 B +12 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 a d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )}\) | \(264\) |
1/12*(((-A+3*B)*cos(2*d*x+2*c)+A*cos(3*d*x+3*c)+(17*A-6*B+12*C)*cos(d*x+c) +31*A-21*B+24*C)*tan(1/2*d*x+1/2*c)-18*x*(A-B+2/3*C)*d)/d/a
Time = 0.25 (sec) , antiderivative size = 113, normalized size of antiderivative = 0.81 \[ \int \frac {\cos ^3(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=-\frac {3 \, {\left (3 \, A - 3 \, B + 2 \, C\right )} d x \cos \left (d x + c\right ) + 3 \, {\left (3 \, A - 3 \, B + 2 \, C\right )} d x - {\left (2 \, A \cos \left (d x + c\right )^{3} - {\left (A - 3 \, B\right )} \cos \left (d x + c\right )^{2} + {\left (7 \, A - 3 \, B + 6 \, C\right )} \cos \left (d x + c\right ) + 16 \, A - 12 \, B + 12 \, C\right )} \sin \left (d x + c\right )}{6 \, {\left (a d \cos \left (d x + c\right ) + a d\right )}} \]
integrate(cos(d*x+c)^3*(A+B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+a*sec(d*x+c)),x, algorithm="fricas")
-1/6*(3*(3*A - 3*B + 2*C)*d*x*cos(d*x + c) + 3*(3*A - 3*B + 2*C)*d*x - (2* A*cos(d*x + c)^3 - (A - 3*B)*cos(d*x + c)^2 + (7*A - 3*B + 6*C)*cos(d*x + c) + 16*A - 12*B + 12*C)*sin(d*x + c))/(a*d*cos(d*x + c) + a*d)
\[ \int \frac {\cos ^3(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=\frac {\int \frac {A \cos ^{3}{\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx + \int \frac {B \cos ^{3}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx + \int \frac {C \cos ^{3}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx}{a} \]
(Integral(A*cos(c + d*x)**3/(sec(c + d*x) + 1), x) + Integral(B*cos(c + d* x)**3*sec(c + d*x)/(sec(c + d*x) + 1), x) + Integral(C*cos(c + d*x)**3*sec (c + d*x)**2/(sec(c + d*x) + 1), x))/a
Leaf count of result is larger than twice the leaf count of optimal. 400 vs. \(2 (133) = 266\).
Time = 0.32 (sec) , antiderivative size = 400, normalized size of antiderivative = 2.88 \[ \int \frac {\cos ^3(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=\frac {A {\left (\frac {\frac {9 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {16 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {15 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}}{a + \frac {3 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {3 \, a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {a \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}}} - \frac {9 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {3 \, \sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} - 3 \, B {\left (\frac {\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {3 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a + \frac {2 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} - \frac {3 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} - 3 \, C {\left (\frac {2 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {2 \, \sin \left (d x + c\right )}{{\left (a + \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )}}{3 \, d} \]
integrate(cos(d*x+c)^3*(A+B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+a*sec(d*x+c)),x, algorithm="maxima")
1/3*(A*((9*sin(d*x + c)/(cos(d*x + c) + 1) + 16*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 + 15*sin(d*x + c)^5/(cos(d*x + c) + 1)^5)/(a + 3*a*sin(d*x + c)^ 2/(cos(d*x + c) + 1)^2 + 3*a*sin(d*x + c)^4/(cos(d*x + c) + 1)^4 + a*sin(d *x + c)^6/(cos(d*x + c) + 1)^6) - 9*arctan(sin(d*x + c)/(cos(d*x + c) + 1) )/a + 3*sin(d*x + c)/(a*(cos(d*x + c) + 1))) - 3*B*((sin(d*x + c)/(cos(d*x + c) + 1) + 3*sin(d*x + c)^3/(cos(d*x + c) + 1)^3)/(a + 2*a*sin(d*x + c)^ 2/(cos(d*x + c) + 1)^2 + a*sin(d*x + c)^4/(cos(d*x + c) + 1)^4) - 3*arctan (sin(d*x + c)/(cos(d*x + c) + 1))/a + sin(d*x + c)/(a*(cos(d*x + c) + 1))) - 3*C*(2*arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a - 2*sin(d*x + c)/((a + a*sin(d*x + c)^2/(cos(d*x + c) + 1)^2)*(cos(d*x + c) + 1)) - sin(d*x + c) /(a*(cos(d*x + c) + 1))))/d
Time = 0.31 (sec) , antiderivative size = 207, normalized size of antiderivative = 1.49 \[ \int \frac {\cos ^3(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=-\frac {\frac {3 \, {\left (d x + c\right )} {\left (3 \, A - 3 \, B + 2 \, C\right )}}{a} - \frac {6 \, {\left (A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{a} - \frac {2 \, {\left (15 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 9 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 16 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 12 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 9 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3} a}}{6 \, d} \]
-1/6*(3*(d*x + c)*(3*A - 3*B + 2*C)/a - 6*(A*tan(1/2*d*x + 1/2*c) - B*tan( 1/2*d*x + 1/2*c) + C*tan(1/2*d*x + 1/2*c))/a - 2*(15*A*tan(1/2*d*x + 1/2*c )^5 - 9*B*tan(1/2*d*x + 1/2*c)^5 + 6*C*tan(1/2*d*x + 1/2*c)^5 + 16*A*tan(1 /2*d*x + 1/2*c)^3 - 12*B*tan(1/2*d*x + 1/2*c)^3 + 12*C*tan(1/2*d*x + 1/2*c )^3 + 9*A*tan(1/2*d*x + 1/2*c) - 3*B*tan(1/2*d*x + 1/2*c) + 6*C*tan(1/2*d* x + 1/2*c))/((tan(1/2*d*x + 1/2*c)^2 + 1)^3*a))/d
Time = 17.94 (sec) , antiderivative size = 153, normalized size of antiderivative = 1.10 \[ \int \frac {\cos ^3(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx=\frac {\left (5\,A-3\,B+2\,C\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (\frac {16\,A}{3}-4\,B+4\,C\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (3\,A-B+2\,C\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+3\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a\right )}-\frac {x\,\left (3\,A-3\,B+2\,C\right )}{2\,a}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (A-B+C\right )}{a\,d} \]